package TestData.DataStructureTestData.treeTestData.binaryTreeTestData;

import DataStructure.tree.binaryTree.binaryTreeImpl.BinaryTreeImpl;

public class BinaryTreeBuildDemo {

    public static BinaryTreeImpl getFullBinaryTreeDemo04() {
        BinaryTreeImpl binaryTree1 = new BinaryTreeImpl(1);
        BinaryTreeImpl binaryTree2 = new BinaryTreeImpl(2);
        BinaryTreeImpl binaryTree3 = new BinaryTreeImpl(3);
        binaryTree1.left = binaryTree2;
        binaryTree1.right = binaryTree3;
        return binaryTree1;
    }

    public static BinaryTreeImpl getBinaryTreeDemo3() {
        BinaryTreeImpl binaryTree1 = new BinaryTreeImpl(1);
        BinaryTreeImpl binaryTree2 = new BinaryTreeImpl(2);
        BinaryTreeImpl binaryTree3 = new BinaryTreeImpl(3);
        BinaryTreeImpl binaryTree4 = new BinaryTreeImpl(4);
        BinaryTreeImpl binaryTree5 = new BinaryTreeImpl(5);
        BinaryTreeImpl binaryTree6 = new BinaryTreeImpl(6);
        BinaryTreeImpl binaryTree7 = new BinaryTreeImpl(7);

        binaryTree1.bind(binaryTree2, binaryTree3, null);
        binaryTree2.bind(binaryTree4, binaryTree5);
        binaryTree3.bind(binaryTree6, binaryTree7);
        return binaryTree1;
    }

    public static BinaryTreeImpl getBinaryTreeDemo3_Mirror() {
        BinaryTreeImpl binaryTree1 = new BinaryTreeImpl(1);
        BinaryTreeImpl binaryTree2 = new BinaryTreeImpl(2);
        BinaryTreeImpl binaryTree3 = new BinaryTreeImpl(3);
        BinaryTreeImpl binaryTree4 = new BinaryTreeImpl(4);
        BinaryTreeImpl binaryTree5 = new BinaryTreeImpl(5);
        BinaryTreeImpl binaryTree6 = new BinaryTreeImpl(6);
        BinaryTreeImpl binaryTree7 = new BinaryTreeImpl(7);

        binaryTree1.bind(binaryTree3, binaryTree2);
        binaryTree2.bind(binaryTree5, binaryTree4);
        binaryTree3.bind(binaryTree7, binaryTree6);
        return binaryTree1;
    }

    public static BinaryTreeImpl getBinaryTreeDemo03_Sub01() {
        BinaryTreeImpl binaryTree3 = new BinaryTreeImpl(3);
        BinaryTreeImpl binaryTree6 = new BinaryTreeImpl(6);
        BinaryTreeImpl binaryTree7 = new BinaryTreeImpl(7);
        binaryTree3.bind(binaryTree6, binaryTree7);
        return binaryTree3;
    }

    public static BinaryTreeImpl getBinaryTreeDemo4() {
        BinaryTreeImpl binaryTree1 = new BinaryTreeImpl(1);
        BinaryTreeImpl binaryTree2 = new BinaryTreeImpl(2);
        BinaryTreeImpl binaryTree3 = new BinaryTreeImpl(3);
        BinaryTreeImpl binaryTree4 = new BinaryTreeImpl(4);
        BinaryTreeImpl binaryTree7 = new BinaryTreeImpl(7);

        binaryTree1.bind(binaryTree2, binaryTree3);
        binaryTree2.bind(binaryTree4, null);
        binaryTree3.bind(null, binaryTree7);
        return binaryTree1;
    }

    public static BinaryTreeImpl getBinaryTreeDemo4_Mirror() {
        BinaryTreeImpl binaryTree1 = new BinaryTreeImpl(1);
        BinaryTreeImpl binaryTree2 = new BinaryTreeImpl(2);
        BinaryTreeImpl binaryTree3 = new BinaryTreeImpl(3);
        BinaryTreeImpl binaryTree4 = new BinaryTreeImpl(4);
        BinaryTreeImpl binaryTree7 = new BinaryTreeImpl(7);

        binaryTree1.bind(binaryTree3, binaryTree2);
        binaryTree2.bind(null, binaryTree4);
        binaryTree3.bind(binaryTree7, null);
        return binaryTree1;
    }

    public static BinaryTreeImpl getBinaryTreeDemo5() {
        BinaryTreeImpl binaryTree1 = new BinaryTreeImpl(1);
        BinaryTreeImpl binaryTree2 = new BinaryTreeImpl(2);
        BinaryTreeImpl binaryTree3 = new BinaryTreeImpl(3);
        BinaryTreeImpl binaryTree4 = new BinaryTreeImpl(4);
        BinaryTreeImpl binaryTree5 = new BinaryTreeImpl(5);
        BinaryTreeImpl binaryTree6 = new BinaryTreeImpl(6);
        BinaryTreeImpl binaryTree7 = new BinaryTreeImpl(7);
        BinaryTreeImpl binaryTree8 = new BinaryTreeImpl(8);
        BinaryTreeImpl binaryTree9 = new BinaryTreeImpl(9);
        BinaryTreeImpl binaryTree10 = new BinaryTreeImpl(10);
        BinaryTreeImpl binaryTree11 = new BinaryTreeImpl(11);
        BinaryTreeImpl binaryTree12 = new BinaryTreeImpl(12);
        BinaryTreeImpl binaryTree13 = new BinaryTreeImpl(13);
        BinaryTreeImpl binaryTree14 = new BinaryTreeImpl(14);
        BinaryTreeImpl binaryTree15 = new BinaryTreeImpl(15);
        BinaryTreeImpl binaryTree16 = new BinaryTreeImpl(16);
        BinaryTreeImpl binaryTree17 = new BinaryTreeImpl(17);
        BinaryTreeImpl binaryTree18 = new BinaryTreeImpl(18);
        BinaryTreeImpl binaryTree19 = new BinaryTreeImpl(19);
        BinaryTreeImpl binaryTree20 = new BinaryTreeImpl(20);

        binaryTree1.bind(binaryTree2, binaryTree3);
        binaryTree2.bind(binaryTree4, binaryTree6);
        binaryTree3.bind(binaryTree7, binaryTree8);
        binaryTree4.left = binaryTree9;
        binaryTree7.bind(binaryTree10, binaryTree11);
        binaryTree8.left = binaryTree12;
        binaryTree9.left = binaryTree13;
        binaryTree10.bind(binaryTree15, binaryTree16);
        binaryTree12.left = binaryTree5;
        binaryTree13.left = binaryTree14;
        binaryTree16.left = binaryTree17;
        binaryTree5.right = binaryTree20;
        binaryTree17.right = binaryTree18;
        binaryTree18.left = binaryTree19;
        return binaryTree1;
    }

    public static BinaryTreeImpl getBinaryTreeDemo6() {
        BinaryTreeImpl binaryTree1 = new BinaryTreeImpl(1);
        BinaryTreeImpl binaryTree2 = new BinaryTreeImpl(2);
        BinaryTreeImpl binaryTree3 = new BinaryTreeImpl(3);
        BinaryTreeImpl binaryTree4 = new BinaryTreeImpl(4);
        BinaryTreeImpl binaryTree5 = new BinaryTreeImpl(5);
        BinaryTreeImpl binaryTree8 = new BinaryTreeImpl(8);
        binaryTree1.bind(binaryTree2, binaryTree3);
        binaryTree2.right = binaryTree4;
        binaryTree3.left = binaryTree5;
        binaryTree5.left = binaryTree8;
        return binaryTree1;
    }
}
